package product.server.impl;

import common.server.entity.InsideRequestMessage;
import common.server.entity.InsideResponseMessage;
import common.server.entity.OutsideRequestMessage;
import common.server.entity.OutsideResponseMessage;
import org.springframework.beans.factory.annotation.Autowired;
import product.api.entity.param.ProductParam;
import product.api.entity.result.ProductPojo;
import product.api.service.IProductService;
import product.server.dao.ProductMapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Title: ProductServiceImpl
 * @ProjectName com-bigwavn-group
 * @Description: 商品中心-业务层实现操作
 * @author: wangweitao 1749343503@qq.com
 * @date: 2019/5/29 15:22
 * @version: V1.0.0
 */
public class ProductServiceImpl implements IProductService {

    @Autowired
    private ProductMapper productMapper;

    /**
     * @Description: 商品中心-商品列表查询
     * @param: [trace, req]
     * @return: common.server.entity.InsideResponseMessage<java.util.List<product.api.platform.entity.result.ProductPojo>>
     * @throws
     * @author: wangweitao
     * @date: 2019/7/8 17:38
     */
    @Override
    public InsideResponseMessage<List<ProductPojo>> getProductList(String trace, InsideRequestMessage<ProductParam> req) {

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("id",req.getReqBody().getId());
        List<ProductPojo> list= productMapper.getProductList(map);
        InsideResponseMessage<List<ProductPojo>> productRes = new InsideResponseMessage<List<ProductPojo>>();
        productRes.setRspBody(list);
        return productRes;
    }
    /**
     * @Description: 商品中心-商品数量查询
     * @param: [trace, req]
     * @return: common.server.entity.InsideResponseMessage<java.util.List<product.api.platform.entity.result.ProductPojo>>
     * @throws
     * @author: wangweitao
     * @date: 2019/7/8 17:38
     */
    @Override
    public InsideResponseMessage<ProductPojo> getProductCount(String trace, InsideRequestMessage<ProductParam> req) {
        return null;
    }

    @Override
    public OutsideResponseMessage<ProductPojo> getProductLists(String trace, OutsideRequestMessage<ProductParam> req) {
        return null;
    }
}
